-- Decompiled with the Synapse X Luau decompiler.

local CommonOHOH = _G.CommonOHOH;
local M={}
M.GetNumberSequenceKeyPoint = function(p5, p6)
	return NumberSequenceKeypoint.new(p5, p6);
end
M.GetColorSequenceKeyPoint = function(p7, p8)
	return ColorSequenceKeypoint.new(p7, p8);
end

M.GetColorSequence = function(p1, p2)
	if #p1 <= 0 then
		warn("no value table");
		return nil;
	end;
	if #p1 == 1 then
		return ColorSequence.new(p1[1]);
	end;
	if #p1 == 2 then
		return ColorSequence.new(p1[1], p1[2]);
	end;
	local v2 = {};
	if p2 then
		if #p2 ~= #p1 then
			warn("value and time num is not equal");
			return nil;
		end;
		if p2[1] ~= 0 then
			warn("start time must be 0 please check");
			return nil;
		end;
		if p2[#p2] ~= 1 then
			warn("end time must be 1 please check");
			return nil;
		end;
	else
		p2 = {};
		for v3 = 1, #p1 do
			table.insert(p2, (v3 - 1) / (#p1 - 1));
		end;
	end;
	for v4, v5 in ipairs(p1) do
		table.insert(v2, M.GetColorSequenceKeyPoint(p2[v4], v5));
	end;
	return ColorSequence.new(v2);
end

M.GetNumberSequence = function(p3, p4)
	if #p3 <= 0 then
		warn("no value table");
		return nil;
	end;
	if #p3 == 1 then
		return NumberSequence.new(p3[1]);
	end;
	if #p3 == 2 then
		return NumberSequence.new(p3[1], p3[2]);
	end;
	local v6 = {};
	if p4 then
		if #p4 ~= #p3 then
			warn("value and time num is not equal");
			return nil;
		end;
		if p4[1] ~= 0 then
			warn("start time must be 0 please check");
			return nil;
		end;
		if p4[#p4] ~= 1 then
			warn("end time must be 1 please check");
			return nil;
		end;
	else
		p4 = {};
		for v7 = 1, #p3 do
			table.insert(p4, (v7 - 1) / (#p3 - 1));
		end;
	end;
	for v8, v9 in ipairs(p4) do
		table.insert(v6, M.GetNumberSequenceKeyPoint(v9, p3[v8]));
	end;
	return NumberSequence.new(v6);
end


return M;
